# 最近游戏匹配
def findByGame(userList, gameName):
    matchPool = []
    for user in userList:
        for game in user["recentGamesName"]:
            if gameName in game:
                matchPool.append(user)
                break
    return matchPool


# 当前游戏匹配
def findByGaming(userList, gameName):
    matchPool = []
    for user in userList:
        for game in user["gamingStatus"]:
            if gameName in game:
                matchPool.append(user)
                break
    return matchPool


# 当前正在游戏匹配
def findByGamingStatus(userList):
    matchPool = []
    for user in userList:
        if len(user["gamingStatus"]) != 0:
            matchPool.append(user)
            break
    return matchPool


# vac状态匹配
def findByVac(userList):
    matchPool = []
    for user in userList:
        for vacInfo in user["vacInfo"]:
            if len(vacInfo) != 0:
                matchPool.append(user)
                break
    return matchPool
